<?php
/**
 * The default template for displaying content
 *
 * Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */

$image =  get_post_meta($post->ID,'art_image', true );
if(empty($image))
    $image    = get_template_directory_uri().'/images/na.jpg';
else
    $image    = 'http://artserv.org/public/files/event/thumb/'.$image;
$imgLink = '<img src="'.$image.'" width=300 >';
$location   = get_post_meta($post->ID,'art_location', true );
$participant   = get_post_meta($post->ID,'art_full_name', true );
$date       = get_post_meta($post->ID,'art_date', true );
$time       = get_post_meta($post->ID,'art_time', true );

$textColor  = get_post_meta($post->ID,'art_text_color', true );
$bgColor    = get_post_meta($post->ID,'art_bg_color', true );
$color      = !empty($textColor)?'#' . $textColor:'#444444';
$bg         = !empty($bgColor)?'#' . $bgColor:"yellow";

if(!empty($participant)){
    $member = explode(',',$participant);
    $participant = array();
    foreach($member as $val){
        $participant[]='<a target="_blank" href="?search-class=DB_CustomSearch_Widget-db_customsearch_widget&widget_number=2&cs-art_full_name-0='.$val.'&search=Search">'.$val.'</a>';
    }
    $participant = implode(",",$participant);
}
?>
<div class="art-table" style="color: <?php echo $color ?>;">
    <div class="item_title"><?php echo $imgLink; ?></div>
    <div class="item_title" style="color: <?php echo $color ?>;background-color:<?php echo $bg ?>">
        <div class="art-item-row">
            <span class="art-item-title">TITLE:</span>
            <span><?php echo the_title()  ?></span>
        </div>
        <div class="art-item-row">
            <span class="art-item-title">LOCATION:</span>
            <span><?php echo $location  ?></span>
        </div>
        <div class="art-item-row">
            <span class="art-item-title">DATE:</span>
            <span><?php echo $date  ?></span>
        </div>
        <div class="art-item-row">
            <span class="art-item-title">TIME:</span>
            <span><?php echo $time  ?></span>
        </div>
        <div class="art-item-row">
            <div class="art-item-title">ARTSERV PARICIPANTS:</div>
            <div><?php echo $participant  ?></div>
        </div>
        <div class="art-item-row">
            <div class="art-item-title">DESCRIPTION/DETAIL:</div>
            <div class="art-item-description"><?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) );  ?></div>
        </div>

    </div>
    <div class="clear"></div>
</div>
